package com.zzxy.mvc12.controller;

import com.zzxy.mvc12.ext.UserExt;
import com.zzxy.mvc12.po.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserAnnoController {
    @RequestMapping("/test")
    public String test(){
        return "forward:/list.do";
    }
    @RequestMapping("List.do")
    public String list(Model model)
    {
       model.addAttribute("username","zhangwuji");
    return "/user/userList";
    }
    @RequestMapping("toRegister")
    public String toRegister(){
        return "/user/register";
    }
    @RequestMapping("register1")
    public String addUser(UserExt ext, Model model){
       model.addAttribute("user",ext);
        System.out.println(ext);

        return "/user/userList";

    }
}
